<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title> Configure your Farmbot account </title>
    <link rel="stylesheet" href="/styles.css">
    <script>
      function showPassword() {
          var x = document.getElementById("password");
          x.type = (x.type === "password") ? "text" : "password";
      }
    </script>
  </head>

  <body>
    <h1>Configure FarmBot <%= version %> </h1>
    <div class="widget">
      <div class="widget-header">
        <h5>FarmBot Web App Account</h5>
      </div>
      <div class="widget-content">
        <form method=post action=configure_credentials>
          <fieldset>
            <label for="email">Email</label>
            <input value="<%= email %>" type="email" name="email" required></p>

            <label for="password">Password</label>
            <div class="password-input-group">
              <input value="<%= password %>" type="password" name="password" id="password" required>
              <img class="eye-icon" src="icon_eye.svg"
                onclick="showPassword()" title="Show password">
            </div>

            <label for="server"> Server </label>
            <input value="<%= server %>" type="url" name=server required></p>
          </fieldset>
          <div>
            <b>WARNING:</b>
            <p>
            Entering a bad password or email at this step will result in a CODE 24 error.
            The device will not come online and you will need to re-run configurator.
            </p>
            <p>
            Always double check your email and password before proceeding.
            </p>
          </div>
      </div>
    </div>
    <div class="button">
      <input type="submit" value="Finish">
    </div>
    </form>

  </body>

</html>
